//
//  NSString+MESstringNet.m
//  LeanCloud练习
//
//  Created by lanou3g on 15/11/18.
//  Copyright © 2015年 王鼎. All rights reserved.
//

#import "NSString+MESstringNet.h"

@implementation NSString (MESstringNet)

//计算字符串高度(对象方法)
-(CGSize)sizeOfTextWithMaxsie:(CGSize)maxsize font:(UIFont *)font{

    NSDictionary *fontdic = @{NSFontAttributeName: font};
    return [self boundingRectWithSize:maxsize options:NSStringDrawingUsesLineFragmentOrigin attributes:fontdic context:nil].size;

}


//计算字符串高度(类方法)
+(CGSize)sizeWithText:(NSString *)text maxSize:(CGSize)maxsize   font:(UIFont *)font{
  return [text sizeOfTextWithMaxsie:maxsize font:font];
}





@end
